/**
 * 指针函数:是函数
 * !!!不要返回局部变量的指针!!!
*/
#include <stdio.h>

char* get_word(char ch);
char* get_word2(char ch);

char* get_word(char ch)
{
    switch (ch)
    {
        case 'A': return "Apple"; 
        case 'B': return "Banana";
        case 'C': return "Cat";
        case 'D': return "Dog";
        default:  return "None";
    }
}

char* get_word2(char ch)
{
    char str1[]="Apple";
    char str2[]="Banana";
    char str3[]="Cat";
    char str4[]="Dog";
    char str5[]="None";
    switch (ch)
    {
        case 'A': return str1; 
        case 'B': return str2;
        case 'C': return str3;
        case 'D': return str4;
        default:  return str5;
    }
}


int main()
{
    char input;
    printf("请输入一个字母:");
    scanf("%c",&input);
    printf("%s\n",get_word(input));
    printf("====\n");

    return 0;
}